var docEl = document.documentElement,
docBody = document.querySelector("body"),
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function() {
    let maxWidth = 750;
    let cw = docEl.clientWidth>maxWidth ? maxWidth : docEl.clientWidth;
    docEl.style.fontSize = cw / 750 * 200 + 'px';
    docBody.style.fontSize = 12 * cw / 750 * 2 + 'px';
};
//在浏览器缩放与加载时根据屏幕大小改变rem
window.addEventListener(resizeEvt, recalc, false);
document.addEventListener('DOMContentLoaded', recalc, false);
$.extend(
    {
        getColor: function(){
            var str = '0123456789abcdef';
            var color = '#';
            for(var i = 0; i < 6; i++){
                color += str.charAt(Math.random*15);
            }
            return color;
        }
    }
);